home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMIBEST4.ADF
/
du4.3
/
DirUtil.doc
< prev
next >
Wrap
Text File
|
1987-07-22
|
19KB
|
409 lines
Summary of new features in 4.3:
--fixed small bugs in Type and Hextype
--renamed "Delete Files" as "Zap Files" for safety (it's placed in an
out-of-the-way corner)
--If no file is clicked, Edit tries to edit whatever is in the R gadget;
if that's blank, it runs anyway.
--If no file is clicked, Run tries to run whatever is in the R gadget.
Run can be "cycled"--it either runs the clicked file and passes R as
an argument (the old way), or it runs the R gadget and passes the
clicked file as an argument.
Run is now much more flexible and useful!
--I deleted 6 lines of C source relating to argc/argv and the final
program size dropped by 2000 bytes!! Scary stuff, kids!
DirUtil 4.3 and these instructions are by
Charles Tyson -- C-M-T on PeopleLink;
C.TYSON on GEnie;
Charles Tyson on FAUG BBS (415-595-2479)
----------------------------------------------------------------------------
DIRUTIL version 4.3
Original Version by Chris Nicotra
Revisions/Enhancements/Fixes by Dave Jobusch,
Rich Medved, Nathan Barber and Charles Tyson
Words of wisdom from a hacker of old:
"This program is in the public domain. That means you can't
sell the damn thing to anyone, and furthermore, I doubt
you'd get much for it."
Overview:
DirUtil helps you maintain and manipulate the files on your disks (and in
RAM) without having to remember the syntax of all the CLI commands. It
allows you to conveniently copy, delete and move groups of files with a
single operation. Remember those wonderful "kitchen magician" appliances
that did everything--sliced, diced and figured your taxes? Well, DirUtil
is one of those.
DirUtil is designed to be run mostly with mouseclicks, and the display is
laid out for convenient mousing around. The display consists of two
windows and several gadgets. On the left is the File Window. Here you
will see the names of all files and subdirectories in the current
directory, listed alphabetically. If there are more files than can fit
in the window, use the long scrollbar (in the center of the screen, just
right of the file window) to see the remaining files.
On the right is the Command Area. Here you see what DirUtil can do with
your files. At the top are six rectangular gadgets naming the common
devices (file storage areas) such as DF0:, DH0: and RAM:. Below that is
a window with two columns of commands, listed alphabetically. If there are
more than 22 commands in your version, the short scrollbar (just to the
left of the command window) will let you see the others.
Below the command window are three string gadgets labelled R, S and D.
These are used to display certain information to you, such as the identity
of the directory that DirUtil is working on. You will also be using these
gadgets to give DirUtil more information about your commands. There is a
fourth string gadget at the bottom of the display (where it says "O.K.").
It is used by DirUtil to send error messages.
Instructions:
You can start DirUtil from CLI (type "run dirutil") or by clicking on its
icon.
In the basic DirUtil operation, you select one or more files in the File
Window by clicking on them with the left mouse button. Then you click on
the appropriate command in the Command Window. DirUtil carries out the
command and waits for another.
When DirUtil begins, it is looking at the files in RAM:. If you have no
files there, the File Window will be blank. There are two ways to bring
files into the File Window. First, you can click on one of the gadgets
above the Command Window. When you click on "DF0:" for example,
DirUtil reads the directory of the disk in Drive 0 and displays it in the
File Window. Click on another device and its files will replace those of
Drive 0. Note that file names are displayed in white--directories are in
yellow. The files contained within directories are not displayed (we'll
get to that in a moment).
When you click on a gadget, the gadget's name appears in the string gadget
marked S. This is the "current directory" for DirUtil--it tells you where
the files in the File Window are located. The second way you can get
files to appear in the File Window is by typing an AmigaDOS directory name
into the S gadget, then pressing RETURN. Typing "df1:" into S is the same
as clicking on the DF1: gadget.
Suppose you see a directory called "Utilities" on the display for DF0:,
and you want to know what files and subdirectories it contains. The easy
way is to doubleclick on the "Utilities" line in the File Window. The
S gadget changes to "df0:Utilities" and the files within Utilities are
shown in the File Window, ready for DirUtil to work on. The same result
can be achieved by typing the full pathname into S (click within the S
gadge to get a cursor; position the cursor after "df0:" and type
"utilities"; press RETURN).
When you click on a file or directory, it is "selected," and its name is
printed in inverse color. Click on it again, and it de-selects: its
colors return to normal. You can select many files at once, but no more
than one directory at a time. (You can also select a combination of
several files and one directory). Note that a file may be selected even
though its name has scrolled out of the File Window. After DirUtil
executes a command, all files and directories are deselected.
With that, you should have enough knowledge to start using DirUtil. What
follows is a list of all commands. Note that some commands work only on
files; some work only on directories; some work on both. A few commands
require you to enter information in the D or R gadgets.
Several of the commands in DirUtil II 4.2 depend on external programs, and
won't work if you don't have those programs in your C: directory. The
commands are Edit, Show and Unarc. Suitable programs for all three
commands are in the public domain.
DF0:
DF1:
DF2:
DH0:
RAM:
VD0:
Clicking on these gadgets means "set the current directory (S) to the root
directory of this device." The root directory is the uppermost level of
files. These commands do not require you to make any selection from the
File Window, of course.
You may not own all the devices listed. If you click on one you don't
have, you'll get a harmless system requester. Click on the requester's
"Cancel" box to make it go away.
When DirUtil begins, its current directory is always RAM:.
If you have a device for which no gadget exists, you can only access it by
typing its name into the S gadget.
Clear all
This is a fast way of deselecting all selected (highlighted) files.
It is the complement to "Select all" (described below).
Copy files to D
This works on files only. It copies file(s) into the directory specified
in the D gadget. Before clicking on the command, you must click
on the D gadget and enter an existing directory name different from the
directory listed in S. If no device name is included, the destination
directory is assumed to be on the same device as the current directory.
Do not put a slash at the end of the pathname given in D.
Don't confuse this with the DOS copy command, where you can specify the
new name of the copied file. DirUtil's copies have the same name as the
originals, and must end up in a different directory.
Cycle file<->R
When you click on this command, notice that the "Run" command changes
from "Run file + R" to "Run R + file" and back. For an explanation of
what this means, see the Run command below.
Delete dir
This command will delete ONE highlighted directory. The directory must
be empty, i.e. contain no files. It won't work if the selected directory
happens to be the AmigaDOS current directory.
Delete files
This command, present in earlier versions of DirUtil, has been renamed
"Zap files." That places it in the corner of the command window where it
is less likely to be hit by accident. See Zap Files below.
Edit a file
Again, for files only. It supposes you have a file editor program named
"E" in your C: directory. If that program exists, it will be loaded into
memory and will be commanded to edit the first selected file. As soon as
the editor starts up, DirUtil is free to do other tasks.
You can, in theory, use any editor program as long as you rename it "E"
and put it in the C: directory. But if the editor doesn't create its own
editing window (e.g. the Amiga ED program), it may not be able to work with
DirUtil.
The command RUN in the C: directory must be present when this command is
chosen.
In version 4.3: if no filename is highlighted but there is something in
the R gadget, DirUtil interprets R as a filename and tries to edit it.
If there is nothing in R, the Editor comes up without attempting to load
any file. (Some editors may complain in this case--Commodore's Edit,
which probably doesn't work with DirUtil anyway, must be called with a
filename or it aborts with an error).
Hex type files
This command is like the CLI command "Type opt h". It displays a file as
a combination of hexadecimal numbers and the associated ASCII characters.
Info on S & D
Nothing in the File Window need be selected. This command displays the
number of unused bytes on the S and D devices. You should check this
before copying to D.
If D is blank, the report for D will be meaningless. Note that RAM: always
reports "0 bytes free," because the ramdisk only uses as much memory as it
needs for the moment.
MakeDir named D
MakeDir creates a single subdirectory with the name given in gadget D.
If a path name is given, the directory can be on another device or within
another directory; otherwise the new directory is added to the current
directory. Nothing need be selected in the File Window.
Move files to D
This command works with files, a directory, of a combination thereof.
D should contain the name of an existing directory or subdirectory on the
current device; if D is blank, selections will be moved to the root
directory.
The selected files are not copied, they are only relocated to a different
directory on the same device. This is like picking up icons and dropping
them into different drawers on the Workbench.
Parent dir
This command moves you up one level in the hierarchy of directories. If
you are in the root directory, nothing happens.
Print textfiles
This causes text files to be printed on your printer. Using this command
with binary (program) files is not advised. DirUtil uses the PRT: device
to execute this command, so you may have to insert your Workbench disk to
get any results.
Rename as D
This command renames one file or directory. If only a name is given
in D, the renamed file stays in the same directory. If a path name is
given as well, the file can move while it is being renamed. But it must
remain on the same device.
Root dir
The root is the highest directory level. This command takes you
immediately to the root, bypassing any intermediate directory levels
(cf. Parent directory above)
Run program + R
Run allows you to start another program from within DirUtil, as though
you had typed "RUN <programname>" from CLI. If the R gadget contains
a string, that string is passed along to the program. (Example: from
CLI you might edit a file by typing "RUN ED DF1:TEXTFILE". From DirUtil,
you could type "DF1:TEXTFILE" into gadget R, click on ED in the File
Window, and click on Run in the Command Window).
New to 4.3: The first paragraph describes the default situation, when
the command reads "Run file + R". If you click the Cycle command, the
command changes to "Run R + file". Now the Run commands means "Run the
program in the R gadget and pass it the first highlighted file as an
argument."
New to 4.3: If no file is highlighted, DirUtil attempts to RUN whatever
is in the R gadget. It will search the current path for the file. With
this option you can type almost any CLI command into the R gadget and
execute it. (A very handy example is to ECHO >PRT: "[setup codes]"
before using the Print Textfiles command--e.g. to turn boldface on or
off, replace [setup codes] with ESC[1m or ESC[0m. Need I say that ESC
means press the ESC key once; don't type E-S-C?)
These changes make Run a very versatile command and will save you a lot
of directory swapping.
If the program produces its own screen or window, that will appear and
be used as the input/output area. Some programs (e.g. those in the C
directory) don't make their own output windows. If DirUtil was started
from CLI, these programs will (I hope) send their output to that CLI. If
DirUtil was started from its icon, the output will (if we're lucky) go to
the funny little window that sits behind DirUtil.
The program RUN in the C: directory must be present when this command is
chosen. Run only works on the first highlighted file--otherwise you
might spawn so many new programs that you'd run out of memory.
It's only fair to warn you that some programs flatly refuse to Run!
Two important CLI commands that don't work are PATH and CD. As far as
DirUtil is concerned, CD is what's in the S gadget. It ignores the CD
of the CLI window it was started from. DirUtil's PATH is the path it
inherited from its CLI, and it can't be changed once DirUtil starts.
Worse, if DirUtil is started from the icon, its path is just Current
Directory (S gadget) -- C directory. That's it.
Search for R
DirUtil will search the selected file(s) for a string of up to 60
characters given in R. The match must be exact--uppercase and lowercase
are distinguished.
If the string contains a backslash character (\), the next two characters
are assumed to be hexadecimal digits representing a single character with
that hex value.
If DirUtil can allocate enough memory, it performs a FAST search, which
is announced on the screen. If it is forced into a SLOW search, you can
abort by pressing the ESC key.
Select all
This is the converse of the Clear selections command. It selects all the
files in the current directory, even those whose names have scrolled off
the top or bottom of the File Window. After selecting all, you are still
free to deselect individual files by clicking on their highlighted names.
Show pictures
For this command to work, you must have a program such as "Show" or
"Showall," one of the public domain programs that display Amiga pictures.
The program must be renamed "Show" and placed in your C: directory.
DirUtil is "frozen" while pictures are being shown. To escape from viewing
a series of pictures, see the procedure mentioned under "Zap files."
Swap S & D
This exchanges the contents of the S and D gadgets and adjusts the File
Window to match. If D is blank, the root of the current directory is
made current. If D doesn't properly describe a directory path, DirUtil
will retreat to the previous S directory or to RAM:.
Total bytes
Use this command to get a count of the total bytes in all selected files.
It won't work on directories.
Type textfiles
This command prints selected text file(s) to the screen (cf. Print files).
For non-text files use the "Hex type files" command. Both type commands
pause after a screenful of text has been displayed; press the spacebar to
proceed to the next page. You can't move back to a previous page. The
return key causes line-by-line scrolling. The ESC key ends viewing of the
current file.
UnARC a file
For this command to work, you must have the public domain "UnARC" program
in your C: directory. The resulting unarced files usually appear in the
same directory with the .ARC file, but sometimes they wander off to another
device...I don't know why. Unarc only works on the first highlighted file
(this is to prevent overflowing your disk).
Zap files
This works only on files, and does just what it says--zaps 'em! Because
of the evident risks of this command, you must click twice to begin a
Delete. The two clicks must be over the Delete command and within a short
period of time, just as though you were doubleclicking on an icon.
There is a way to abort the delete command (or any DirUtil command that
works on more than one file): move the mouse into the File Window and
click there. If DirUtil hasn't already deleted everything, it will stop.
A few words on customizing:
There are two things about DirUtil you might want to change: the name of
the editor, and the list of gadgets at the top. To do this, you must have
an editor that can handle binary files. Commodore's ED won't do; EDIT
might work but you need to specify a longer line length than the default.
I've heard that Filezap, a PD editor, works fine. I use a commercial
editor, TxEd, myself.
The critical point to remember is that you must REPLACE bytes, not add or
subtract them. Your edited version of DirUtil must be exactly as long as
the original or it won't run.
If you intend to try this, MAKE A BACKUP COPY FIRST!!!
Changing the editor: search DirUtil for the string "run >nil: e". You
should find only one occurence. "e" will be followed by seven spaces,
so your new editor name can be up to eight characters long. If you don't
keep your editor in the C: directory (you really should), you may have to
squeeze in a device:directory/ as well as the name.
Changing devices: Suppose you don't have a hard drive (I don't!) so you
don't need DH0:. But you do have a fourth floppy drive (I don't!) called
DF3:. Search DirUtil for the string "DH0:". You'll find it twice--once
in capitals, once in lowercase. The first is the gadget text, the second
is part of the command to switch devices. Change both to DF3:, save the
file, and DF3: should appear in future.
(Note: the word "ram:" appears several times in DirUtil...better leave
that device alone!)
Finally, a bug report:
The "Run program" command won't work if there are selected filename
contains spaces. As soon as the CLI RUN command sees the space, it thinks
the filename is finished. The same thing would happen if you tried to run
the program from CLI--the solution there would be to enclose the filename
in quotes. I tried some easy fixes to this but other problems came up,
so I have elevated this from a Bug to a Feature. Man was not meant to
embed spaces in filenames, and DirUtil punishes him if he transgresses.